<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>新增退费</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="新增,退费">
	<meta http-equiv="description" content="This is my page">

  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'退费管理'},{'name':'交费情况'},{'name':'新增退费'}]"/>
    			<jsp:param name="width" value="40%"/>
    		</jsp:include>
    		
    		<s:hidden id="childId" name="refund.child.id"></s:hidden>
    		<s:hidden id="kindergartenId" name="kindergartenId"></s:hidden>
    		<s:hidden id="classId" name="refund.cla.id" value="%{child.cla.id}"></s:hidden>
    		
    		<table cellspacing="1" cellpadding="3" width="70%" bgcolor="#CCCCCC">
				<tr bgcolor="#FFFFFF">
					<td align="right" width="12%" class="label">
						学童姓名：
					</td>
					<td align="left" width="21%">
						<s:property value="child.childName"/>
					</td>
					<td align="right" width="12%" class="label">
						所属班级：
					</td>
					<td align="left" width="21%">
						<s:property value="child.cla.className"/>
					</td>
					<td align="right" width="12%" class="label">
						退费日期：
					</td>
					<td align="left" width="22%">
						<s:textfield readonly="true" name="refund.refundDate" id="refundDate" cssStyle="width:100px" value="%{today}"></s:textfield>
					</td>
				</tr>
				<tr bgcolor="#FFFFFF">
					<td align="right" class="label">
						退款人：
					</td>
					<td align="left" colspan="2">
						<s:textfield name="refund.refundMan" id="refundMan" value="%{user.username}" cssStyle="width:98%;" maxlength="25"></s:textfield>
					</td>
					<td align="right" class="label">
						退款单位：
					</td>
					<td align="left" colspan="2">
						<s:textfield name="refund.unitName" id="unitName" value="%{kindergarten.kgName}" cssStyle="width:98%;" maxlength="25"></s:textfield>
					</td>
				</tr>
				<tr bgcolor="#FFFFFF">
					<td align="right" class="label">
						备注：
						<br>
    					<font color="red">(40字以内)</font>
					</td>
					<td align="left" colspan="5">
						<s:textarea name="refund.remark" id="remark" cssStyle="width:98%; height:120px;"></s:textarea>
					</td>
				</tr>
			</table>
			
			<table width="100%" cellspacing="0">
    			<tr>
    				<td align="center" valign="bottom" height="30">
    					<input type="button" value="新增" class="btn" onclick="addRefund()" />
    				</td>
    			</tr>
    		</table>
    		
    	</s:form>
    </center>
    
    <script type="text/javascript">
    function addRefund()
    {
        var remark = $('#remark');
        if(remark.val().length > 40)
        {
			showMsg('备注不能超过40字。', function(){
				remark.focus();
			});
			return;
        }
        var url = 'inner/charge/addRefund.action';
		ajaxAction(url, 'post', 'frm', true, function(obj){
			var url = 'inner/charge/toUpdateRefund.action?refund.id=' + obj.id;
			window.location.href = url;
		});
    }
    </script>
  </body>
</html>
